{__NOLAYOUT__}<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>自定义标签管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK type="text/css" rel="stylesheet" href="{__ASSETS__}/images/label.css">
<SCRIPT type="text/javascript">
<!--
var lang = new Array();
var userAgent = navigator.userAgent.toLowerCase();
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);
function setcopy(text, alertmsg){
	if(is_ie) {
		clipboardData.setData('Text', text);
		alert(alertmsg);
	} else if(prompt('请按键盘 Ctrl + C 复制到剪切板', text)) {
		alert(alertmsg);
	}
}
//-->
</SCRIPT>
<SCRIPT type="text/javascript">
function copy()
{
	var Result=document.getElementById('content').value;
	if(document.getElementById('content').value != '')
	{
	window.clipboardData.setData("Text",Result); 
	document.getElementById('content').select();
	window.alert('已复制成功！');
	}
}
function Empty()
{
	document.getElementById('content').value='';
	document.getElementById('content').select();
}
function GetFocus()
{
 document.getElementById('content').focus();
}

/***********************************/
function toGB(objv){ //转为GB2312 ( 我们 = &#x6211;&#x4EEC; = \u6211\u4eec)
	objv = unescape(objv.replace(/&#x([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]);/g,'%u$1'));
	objv = unescape(objv.replace(/\\u([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9])/g,'%u$1'));
	return objv;
}
function toUnicode(objv){ //转为Unicode ( &#X6211;&#X4EEC; = 我们 )
	objv = objv.replace(/[^\u0000-\u00FF]/gi,function($0){return escape($0).replace(/(%u)(\w{4})/gi,"&#x$2;")});
	//if (/[\u0000-\u00ff]/g.test(objv))
	objv = objv.replace(/\\u([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9])/gi,'&#x$1;');
	objv = replaceRegUpperCase(/&#x\w{4}/g,objv);
	objv = objv.replace(/(&#X)(\w{4});/g,"&#x$2;");
	return objv;
}
function toJSUnicode(objv){ //转为Unicode ( &#X6211;&#X4EEC; = 我们 )
	objv = objv.replace(/[^\u0000-\u00FF]/gi,function($0){return escape($0).replace(/(%u)(\w{4})/gi,"\\u$2")});
	objv = objv.replace(/&#x([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]);/gi,'\\u$1');
	objv = replaceRegLowerCase(/\\u\w{4}/g,objv);
	return objv;
}

/***________________________________***/
var to16 = {
	on : function (str) {
		var a = [], i = 0;
		for (; i < str.length ;) a[i] = ("00" + str.charCodeAt(i ++).toString(16)).slice(-4);
		return "\\u" + a.join("\\u");
	},

	un : function (str) {
		return unescape(str.replace(/\\/g, "%"));
	}
};
//alert(to16.on("\"请输\"")); //即 \u0022\u8bf7\u8f93\u0022
//alert(to16.un("\\u0022\\u8BF7\\u8F93\\u0022")); //即 "请输"

var toHTML = {
	on : function (str) {
		var a = [], i = 0;
		for (; i < str.length ;) a[i] = str.charCodeAt(i ++);
		return "&#" + a.join(";&#") + ";";
	},

	un : function (str) {
			return str.replace(/&#(x)?([^&]{1,5});?/g, function (a, b, c) {
			return String.fromCharCode(parseInt(c, b ? 16 : 10));
		});
	}
};
//alert(toHTML.on("\"请输\"")); //即 &#34;&#35831;&#36755;&#34;
//alert(toHTML.un("&#x22;&#x8BF7;&#x8F93;&#34;")); //即 "请输"
/***________________________________***/

/***********************************/

function decode(objv){ //转为GB2312 ( 我们 = &#x6211;&#x4EEC; = \u6211\u4eec)
	objv = toHTML.un(objv);
	objv = toGB(objv);
	var thec = document.getElementById('content');
	thec.value = objv;
}
function encode(objv){ //转为Unicode ( &#X6211;&#X4EEC; = 我们 )
	objv = toHTML.un(objv);
	objv = toUnicode(objv);
	var thec = document.getElementById('content');
	thec.value = objv;
}
function jsencode(objv){ //转为JS Unicode  ( \u6211\u4eec = 我们 )
	objv = toHTML.un(objv);
	objv = toJSUnicode(objv);
	var thec = document.getElementById('content');
	thec.value = objv;
}

function replaceRegLowerCase(reg,str){ 
	//str = str.toLowerCase(); 
	return str.replace(reg,function(m){return m.toLowerCase()}) 
}
function replaceRegUpperCase(reg,str){ 
	//str = str.toUpperCase(); 
	return str.replace(reg,function(m){return m.toUpperCase()}) 
}

function encode2(objv){ //转为Unicode ( &#X6211;&#X4EEC; = 我们 )
	objv = toGB(objv);
	if(objv!="") objv = toHTML.on(objv);
	var thec = document.getElementById('content');
	thec.value = objv;
}

function ConvertChar($id) {
	if(typeof cv =="undefined" || cv == null || cv == 1) { cv = 0; } else { cv = 1; }
	if(typeof $id =="undefined" || $id == null || $id == "") return;
	var content = document.getElementById($id);
	if(cv == 0) { 
		encode(content.value);
	} else {
		decode(content.value);
	}
}
</SCRIPT>
<META content="MSHTML 6.00.6000.21115" name="GENERATOR">
</HEAD>
<BODY>
<TABLE class="tb_style" cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD style="BORDER-TOP: #e2f5bc 4px solid; BACKGROUND: #fafbf7; BORDER-BOTTOM: #e2f5bc 1px solid" height=35>
	&nbsp;
<INPUT class="{if ACTION_NAME='index'}rb2{else}rb1{/if}" onclick="location='{:U(MODULE_NAME & '/index')}';" type=button value=管理首页>
<INPUT class="{if ACTION_NAME='addtag'}rb2{else}rb1{/if}" onclick="location='{:U(MODULE_NAME & '/addtag')}';" type=button value=添加新标签>
<INPUT class="{if ACTION_NAME='sortlist'}rb2{else}rb1{/if}" onclick="location='{:U(MODULE_NAME & '/sortlist')}';" type=button value=标签分类管理>
<INPUT class="rb1" onclick=javascript:self.location.reload(); type=button value=刷新本页>
    </TD></TR>
  </TBODY>
</TABLE>
